home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
util
/
boot
/
SuperPass21.lha
/
reboot.lzx
/
REBOOT.S
< prev
next >
Wrap
Text File
|
1995-06-15
|
2KB
|
139 lines
_AbsExecBase EQU 4
_LVOOpenLibrary EQU -$0228
_LVOCloseLibrary EQU -$019e
_LVOColdReboot EQU -$02d6
_LVODelay EQU -$00c6
_LVOReadArgs EQU -$031e
_LVOFreeArgs EQU -$035a
_LVOEasyRequestArgs EQU -$024c
lea dosName(PC),A1
move.l #36,D0
move.l _AbsExecBase,A6
jsr _LVOOpenLibrary(A6)
move.l d0,_DosBase
beq ExitError
lea intuitionName(PC),A1
move.l #36,D0
jsr _LVOOpenLibrary(A6)
move.l d0,_IntuitionBase
beq ExitError
move.l #argTemplate,d1
move.l #argArray,d2
moveq #0,d3
movea.l _DosBase,a6
jsr _LVOReadArgs(a6)
move.l d0,rdArgs
beq ExitError
tst.l argForce
bne.s 5$
bsr Asegurar
tst.l D0
bne.s 5$
bsr CloseAll
moveq #0,d0
rts
5$:
move.l #12,D1
movea.l _DosBase,A6
jsr _LVODelay(A6) ; Esperar medio segundo
move.l _AbsExecBase,A6
jsr _LVOColdReboot(A6) ; Resetear sistema
Asegurar
suba.l A0,A0
lea easy,A1
suba.l A2,A2
suba.l A3,A3
move.l _IntuitionBase,A6
jsr _LVOEasyRequestArgs(A6) ; Sacar requester con confirmación
rts
dc.b '$VER: reboot 1.2 By Ramírezoft (26.12.92)',0 ; Version string
even
ExitError
bsr CloseAll
move.l #20,d0
rts
CloseAll
move.l rdArgs,d1
beq \IntuitionLib
movea.l _DosBase,a6
jsr _LVOFreeArgs(a6)
\IntuitionLib
tst.l _IntuitionBase
beq \DosLib
movea.l _IntuitionBase,a1
movea.l _AbsExecBase,a6
jsr _LVOCloseLibrary(a6)
\DosLib
tst.l _DosBase
beq \EndCloseAll
movea.l _IntuitionBase,a1
movea.l _AbsExecBase,a6
jsr _LVOCloseLibrary(a6)
\EndCloseAll
rts
argTemplate
dc.b "FORCE/S",0
even
argArray
argForce
dc.l 0
rdArgs
dc.l 0
easy:
dc.l 20,0 ; es_StructSize, es_Flags
dc.l 0 ; es_Title
dc.l easyText ; es_TextFormat
dc.l easyGadget ; es_GadgetFormat
easyText:
dc.b 'Do you wish to reboot the system?',10,10
dc.b '(Suspend ALL disk activity)',0
even
easyGadget:
dc.b 'Yes|No',0
even
dosName:
dc.b 'dos.library',0
even
intuitionName:
dc.b 'intuition.library',0
even
_DosBase:
dc.l 0
_IntuitionBase
dc.l 0
end